module Yahtzee #nodoc:
  class Turn 

    attr_reader :dice
    attr_reader :roll_count
  
    def initialize(dice = Yahtzee::Dice.new)
      @dice = dice;
      @roll_count = 0
    end

    def roll(keep = [])
      raise "Turn is over" if over?
      @roll_count += 1
      @dice.roll(keep)
    end

    def over?
      @roll_count > 2 || yahtzee?
    end

    def yahtzee?
      @dice.yahtzee?
    end

  end  
end